/*
package com.wishtree.common.config;

import com.wishtree.common.filter.JWTLoginFilter;
import com.wishtree.common.filter.JWTValidFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.servlet.HandlerExceptionResolver;

@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
//    @Qualifier("handlerExceptionResolver")
    private HandlerExceptionResolver resolver;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers(
                        "/login","/graphiql",
                        "/vendor/**","/graphiql.html",
                        "/graphql","/subscriptions",
                        "/users",
                        "/**"
                )
                .permitAll().anyRequest().authenticated()
                .and().addFilter(new JWTValidFilter(authenticationManager(),resolver))
                .addFilter(new JWTLoginFilter(authenticationManager(),resolver));
        http.cors().disable();
        http.csrf().disable();
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
*/
